using UnityEngine;

public class AnimatioTexture : MonoBehaviour
{
	public Renderer rend;

	public float speed = 5f;

	private float offset;

	public GameObject Rotor;

	public RCC_CarControllerV3 carController;

	public GameObject[] Whell;

	public CarFunction carFunction;

	private void Start()
	{
		rend = GetComponent<Renderer>();
	}

	private void Update()
	{
		if (rend != null)
		{
			offset += Time.deltaTime * speed;
			rend.material.mainTextureOffset = new Vector2(0f, offset);
		}
		Rotor.transform.Rotate(0f, 0f, Time.deltaTime * 500f);
		if (!(carController == null) && (carController.enabled || carFunction.m_PlayerInCar))
		{
			for (int i = 0; i < Whell.Length; i++)
			{
				Debug.Log("DSADA");
				Whell[i].transform.Rotate(0f, 0f, Time.deltaTime * 250f);
			}
		}
	}
}
